/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author TANGQUOCTUAN
 */
@Embeddable
public class BookTableDetailsPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "BookTableID", nullable = false)
    private int bookTableID;
    @Basic(optional = false)
    @Column(name = "TableNumber", nullable = false)
    private int tableNumber;

    public BookTableDetailsPK() {
    }

    public BookTableDetailsPK(int bookTableID, int tableNumber) {
        this.bookTableID = bookTableID;
        this.tableNumber = tableNumber;
    }

    public int getBookTableID() {
        return bookTableID;
    }

    public void setBookTableID(int bookTableID) {
        this.bookTableID = bookTableID;
    }

    public int getTableNumber() {
        return tableNumber;
    }

    public void setTableNumber(int tableNumber) {
        this.tableNumber = tableNumber;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) bookTableID;
        hash += (int) tableNumber;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BookTableDetailsPK)) {
            return false;
        }
        BookTableDetailsPK other = (BookTableDetailsPK) object;
        if (this.bookTableID != other.bookTableID) {
            return false;
        }
        if (this.tableNumber != other.tableNumber) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.BookTableDetailsPK[bookTableID=" + bookTableID + ", tableNumber=" + tableNumber + "]";
    }

}
